package com.kinyx.framework.db.daos;

import lombok.AllArgsConstructor;

@AllArgsConstructor
enum DMLType {

	// SQL CHANGE
	insert(Type.CHANGE), update(Type.CHANGE), delete(Type.CHANGE), saveEntity(Type.CHANGE), deleteEntity(Type.CHANGE), noChange(null),
	// SQL BATCH CHANGE
	batchInsert(Type.BATCH_CHANGE), batchUpdate(Type.BATCH_CHANGE), batchDelete(Type.BATCH_CHANGE),
	// SQL SELECT
	queryValue(Type.QUERY), queryList(Type.QUERY), queryOne(Type.QUERY), queryPage(Type.QUERY),
	// HQL CHANGE
	persis(Type.CHANGE), merge(Type.CHANGE), remove(Type.CHANGE),
	// HQL BATCH CHANGE
	persisList(Type.BATCH_CHANGE), mergeList(Type.BATCH_CHANGE), removeList(Type.BATCH_CHANGE),
	// HQL SELECT
	findValue(Type.QUERY), findList(Type.QUERY), findOne(Type.QUERY), findPage(Type.QUERY),;

	Type type;

	boolean isChange() { return Type.CHANGE.equals(this.type); }

	boolean isBatchChange() { return Type.BATCH_CHANGE.equals(this.type); }

	boolean isQuery() { return Type.QUERY.equals(this.type); }

}
